package com.basic.controller;

import com.basic.domain.ApiResult;
import com.basic.service.MyGenService;
import com.basic.service.vo.DataBasesParam;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

@RestController("/gen")
public class GenController {

    @Autowired
    private MyGenService genService;

    @PostMapping("/zipCode")
    public ApiResult<String> zipCode(@RequestBody @Validated DataBasesParam param) {

        genService.connectAndGetData(param);
        return ApiResult.ok("ok");
    }

}
